package com.oha.laporrayelchurro.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.oha.laporrayelchurro.model.Partido;
import com.oha.laporrayelchurro.service.PartidoService;

public class PorraServlet  extends BaseServlet{

	/**
	 * serialization
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * pais Service
	 */
	private PartidoService pService = new PartidoService();
	
	/**
	 * accion get
	 */
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		showData(req, resp);
	}
	
	/**
	 * Muestra los datos
	 * @param req
	 * @param resp
	 * @throws ServletException
	 * @throws IOException
	 */
	private void showData(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{
		List<Partido> pList = pService.getPorras();
		req.setAttribute("modelList", pList);
		goToView(req, resp, "/pages/porra.jsp");
	}

}
